/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.component;

import java.awt.FlowLayout;
import java.awt.event.ItemListener;

import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import com.ruipengkj.commons.util.Util;
import com.ruipengkj.view.baseDataView.DataCommodityAddOrModifyDialog;
/**
 * 说明：
 * 文本+文本域
 * @Author：李智深
 * @Date：2012-03-14
 */
public class JLabelJTextCheckBoxComponent extends JPanel {
	
	private static final long serialVersionUID = 1L;
	private JCheckBox checkBox;
	public JLabelJTextCheckBoxComponent(String lable){
		this.setLayout(Util.FlowLayout(FlowLayout.LEFT));
		JLabel label=new JLabel(lable);
		checkBox=new JCheckBox();
		this.add(label);
		this.add(new JScrollPane(checkBox));
	}
	public Boolean getSelected() {
		if(checkBox.isSelected()){
			return true;
		}else{
			return false;	
		}
	}
	public void addListener(DataCommodityAddOrModifyDialog dialog){
		checkBox.addItemListener((ItemListener) dialog);
	}
	public void setSelected(boolean isSelected) {
		checkBox.setSelected(isSelected);
	}
}
